﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<PagetedList<Blog.Models.Comment>>" %>
<%@ Import Namespace="Spirit.Portal.Core.Web"%>
<%@ Import Namespace="Blog.Models"%>
<%@ Import Namespace="Blog.Models.MenuServices"%>
<%@ Import Namespace="Blog.Helper"%>
<%@ Import Namespace="Blog.Models.UserServices"%>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Details
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <fieldset>
        <legend>(*_+)V(*._.)</legend>
     <%
         IMenuRepository db=new MenuRepository();
         IUserRepository db1 = new UserRepository();
         int x=(int)ViewData["id"];
         var c=db.Getdata(x);
         ViewData["BODY"] = c.Body;
         %>   
        <div class="chitiet">
       <h2>
       <%=Html.ActionLink(c.TiTle, "Details", new { Controller = "Menu", id = c.ArticleId })%>
       </h2>
       <p>
       <%=ViewData["BODY"] %>
       <%=Html.Encode("...")%>
       </p>   
 <%
     if(Model!=null){
         foreach (var d in Model)
         {
             ViewData["author"] = db1.Getdata(d.UserId).UserName;
             %>
            <fieldset>
            <legend><%=Html.Encode(ViewData["author"]) %></legend>
            <p><%=Html.Encode(d.Body) %></p>
            </fieldset>
        <% }
      }%>
   
<% if (Model.HasPreviousPage) { %> 
 
    <%= Html.RouteLink("<<<",  
                       "UpcomingDinners2",  
                       new { page=(Model.PageIndex-1) }) %> 
 
<% } %> 
 
<% if (Model.HasNextPage) { %> 
 
    <%= Html.RouteLink(">>>",  
                       "UpcomingDinners2",  
                       new {page = (Model.PageIndex + 1) })%> 
 
<% } %> 

        <% using (Html.BeginForm()) {%>
        <%=Html.TextArea("Comment") %>
        <% if (Session.IsAuthenticate())
           { %>
        <p>
           <input type="submit" value="SendComment" />
        </p>
        <%}
else
{%>
    <div id="block">
    Send Comment is block
    <div>
    </div>
    please logon
    </div>
<%} %>
        
        <% } %>
    </fieldset>
    <p>

        <%= Html.ActionLink("Edit", "Edit", new { id=(int)ViewData["id"] }) %> |
        <%= Html.ActionLink("Xóa", "Delete", new { id = (int)ViewData["id"] })%>|
        <%= Html.ActionLink("Back to List", "Index",new {Controller="Home"}) %>
    </p>

</asp:Content>

